
\documentclass[letterpaper,12pt,titlepage]{article}

\usepackage{url}
\usepackage{array}
\usepackage{verbatim}

\newcolumntype{L}[1]{%
>{\raggedright\hspace{0pt}}p{#1}}%

\newenvironment{solidsubsection}[1] {
  \noindent
  \begin{minipage}{0.9\textwidth}
  \setlength{\parindent}{.5cm}
  \subsection{#1}
} {
  \end{minipage}
  \bigskip
  \bigskip
}

\begin{document}
\title{Fanorona Game Manager\\User's Manual}
\author{James~Andariese \and Jeremiah~Lewis \and Matt~Rykaczewski}
\maketitle

\tableofcontents
\pagebreak

\section{Introduction}
Fanorona Game Manager is a software product designed to allow clients to
connect via a TCP connection on port 3266 to play a game of Fanorona.
The game manager was especially designed with artificial intelligence in
mind and so has its own game board display to free developers of ``bots''
from the burden of generating their own display.

When a game is played, moves are validated to ensure accuracy and fair play.

\newpage
\section{Starting Up}

To start Fanorona Game Manager, you will need to run a Java\texttrademark
runnable JAR file.  The procedure varies by operating system and version
and the following list is only some common examples.

You will be asked to provide a directory to store game logs in 
(See Options - Logging Directory on page \pageref{sec:loggingdirectory}).

\medskip

\begin{center}
\begin{tabular}{c | L{0.4\textwidth} | l}
%\begin{tabular}{c | l | l}
\hline
System & Method & Notes \\ \hline \hline
Windows & double click the jar file, \verb/fgm-<version>.jar/ & \\ \hline
Linux & from command line, 
\verb/java -jar fgm-version.jar/ & must be in X \\ \hline
Mac OS & double click the jar file, \verb/fgm-<version>.jar/ & \\ \hline
\end{tabular}
\end{center}

\newpage
\section{Connecting}

Once the game manager has loaded, it will display some diagnostic information
including the port on which the server is listening.
At the end of this list will be the text \verb/Waiting for connection 1/
indicating that the server is waiting for a connection.

Once a connection is made by both participants, sides will be assigned.  This
can be done randomly or in the order in which connections are made with white
being the first client to connect (See Options - Random Sides on page \pageref{sec:randomsides}).

\newpage
\section{During the Game}

As a game progresses, you will be able to see the board's current state.
You can change the representation of the board from the fairly boring and
high contrast version used by default to a stylized version which is easier
on the eyes if you will be using the product for an extended period.
See Options - Fancy Board on page \pageref{sec:fancyboard}.

If a client gets stuck and the game needs to be aborted, you may declare
a draw game by clicking ``draw game'' in the tool bar.  This will immediately
disconnect both clients sending them an error.

\newpage
\section{After the Game}

When a game is completed, it will have a log stored in the directory you
chose when you first started the game manager
(See Options - Logging Directory on page \pageref{sec:loggingdirectory}).

To easily view these, you may open the File menu, navigate to ``Open Log'',
and select a game you wish to review.  Up to 10 filenames will be stored in
this menu but the files in the logging directory have no such limit.

When you select a file from the menu, it will be opened with the default
file handler for ``txt'' files your operating system if available or with
notepad if possible.  You may use a built in notepad if the default does
not work (See Options - Java Notepad on page \pageref{sec:javanotepad}).

\newpage
\section{Built-in ``Bots''}

If an opponent is needed, there are some ``bots'' or automated clients
included which may be used for testing.  These were written by 
James~Andariese and consequently may not be used as a hand in for an
assignment if it is not allowed by your teacher.  These fall under the
same license as the rest of the project, however, and may be used freely
where otherwise allowed.

The random bot will make random moves which are
decent for testing game logic.  Random bot will not make more than one
move at a time even if available.

Todd is a somewhat more intelligent bot which will make the least dangerous
move based on a single round of play.  This is a good choice to test an
artificial intelligence which has moved beyond a single depth move search.
It should beat Todd handily.

\newpage
\section{Options}

\begin{solidsubsection}{Random Sides}
\label{sec:randomsides}
In the Options menu, the option ``Random Sides'' allows you to choose between
the players being assigned random sides or being given sides based on the
order in which they connect with white coming first.
\end{solidsubsection}


\begin{solidsubsection}{Java Notepad}
\label{sec:javanotepad}
This copy of Fanorona Board Manager includes a built-in text file reader
which is capable of basic editing and printing.  If you require its use,
navigate to the Options menu and check the option titled ``Java Notepad''.

If this option is unchecked, the notepad version which is used depends on
your system and version of Java\texttrademark{}.  If you are using
Java\texttrademark 1.5\footnotemark or later, an attempt will be made to load your
system default for ``txt'' files.  If you are using Java\texttrademark
versions earlier than 1.5, an attempt will be made simply to run 
Windows\texttrademark Notepad which will not succeed on systems which 
are not based on Windows\texttrademark.

In all cases, if these fail, the built in notepad will be loaded regardless
of the option selection.
\end{solidsubsection}

\footnotetext{Java\texttrademark version 1.5 is sometimes also called JavaSE 5.
Your version can be determined by typing java -version at the command line}

\begin{solidsubsection}{Logging Directory}
\label{sec:loggingdirectory}

The logging directory used by the game manager is where all game logs are
saved.  The name used will be the randomly generated Game ID and the format
is plain text.\footnotemark
You can find the game ID in the on screen log when a game ends.

When you first start Fanorona Game Manager, you will be prompted for a
directory in which to store these logs.  If you later wish to change it,
navigate to the File menu and select ``Change Logging Directory''.  A
dialog box will appear and you will be able to choose a new directory in it.
\end{solidsubsection}
\footnotetext{An example is {\textsc 8eca40f4-7e49-47c7-a79f-a41b8e6d2841.txt.}}

\begin{solidsubsection}{Fancy Board}
\label{sec:fancyboard}

If you wish to change the style of board displayed, you can do so by
navigating to the Options menu and selecting ``Fancy Board''.

If checked,
a stylized paper board will be displayed which is lower contrast than the
default and easier to look at.  

If unchcked, a high contrast, 
slightly more memory efficient display will be used which is easier to
look at for a short time but quickly strains the eyes with prolonged use.

In some systems, the pieces of the stylized board may not load correctly
and on those systems, a sensible default will be chosen.
\end{solidsubsection}

\newpage
\section{Appendix A - README.txt}
\label{sec:readme.txt}

This file is also available in the source tree.

\verbatiminput{README.txt}

\newpage
\section{Appendix B - LICENSE}
\label{sec:license}
{\footnotesize
\verbatiminput{src/edu/alaska/uaa/cs401/fgm/LICENSE}
}

\newpage
\section{Appendix C - Included Works}

Fanrona Game Manager includes other works.  Their legal information follows.

\subsection*{JUnit}
JUnit may be included depending on the distribution you've received.  It is
licensed under the Creative Public License Version 1.0 available at
\url{http://www.opensource.org/licenses/cpl1.0.php}.

\subsection*{SBFE}

SBFE, the included Java Notepad, is copyright 2009 James Andariese and is
available under the 3 clause BSD license.

\subsection*{Todd and Random Bot}
Todd and Random Bot are copyright 2009 James Andariese and are available
under the 3 clause BSD license.

\subsection*{Graphics}
Graphics used in this game are copyright 2009 James Andariese and
are available under the {\textsc Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License}
available at \url{http://creativecommons.org/licenses/by-nc-sa/3.0/us/}.

\end{document}


